import numpy as np


class Vec3:
    def __init__(self, x, y, z):
        self.x = x
        self.y = y
        self.z = z
    
    def xy(self):
        return (self.x, self.y)

class Mth:
    def rotate_vector(vector, angle):
        """旋转一个二维向量"""
        theta = np.deg2rad(angle)  # 将角度转换为弧度
        rotation_matrix = np.array([
            [np.cos(theta), -np.sin(theta)],
            [np.sin(theta), np.cos(theta)]
        ])
        return np.dot(rotation_matrix, vector)
    
    def tuple_add_x(tuple, length):
        tuple[0] += length
    
    def tuple_add_y(tuple, length):
        tuple[1] += length